<%--
 *  File:    NotesHistorySummary.jsp
 *  @Author: RaelZhu
 *  Date:    Monday, July 14, 2003

 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>

<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>
<%@ page contentType = "text/html;charset=UTF-8" %>

<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  Category cat = Category.getInstance("jsp.NotesHistorySummary");
  String strModuleName = "BIEE";
  String privilegeCode = "Z0405";
  String strTableName = "ovnotes";
%>

<%@include file="/inc/PageDefault.inc"%>
<%@include file="/inc/Security.inc"%>
<%@include file="/inc/FrmDefault.inc"%>
<%@include file="/inc/LocationDefault.inc"%>

<html>
<head>
<title>noteshistorysummary</title>

<PageFlow:CheckPageFlow pageName="noteshistorysummary"/>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>
<%@ include file="/inc/SumDiv.inc" %>
<script language="JavaScript" src="../js/ScriptLib.js"></script>
<script language="JavaScript" src="../js/SummaryDivision.js"></script>
<script language="JavaScript">

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "NotesHistorySummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function clickNote(id)
{
  cform.notesid.value = id;
}

function page_delete()
{
  //alert("Delete: "+ cform.notesid.name + "=" + cform.notesid.value);
  //return;
  
  if (cform.notesid.value == -1)
  {
    alert("<%= message.getMessageDesc("PLEASE_SELECT") %>");
    return;
  }
  
  if (!confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>")) return;
  
  cform.actionname.value = "delete";
  cform.target.value = "_self";
  isRunning = true;
  cform.submit();  
}

</script>
</head>
<body>

<form name="cform" method="post" action="../Dispatcher">
   <input type="hidden" name="pagename" value="noteshistorysummary">
   <input type="hidden" name="actionname">

<%@include file="/inc/PageLocation.inc" %>

<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <tr> 
    <td class="summary_top"> </td>
  </tr>
  <tr> 
    <td> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
      
          <tr class="deepblue-left"> 
            <td width="30" class="title_center">&nbsp;</td>
            <td width="400" class="title_center"><%= label.getLabelName("L_Title") %></td>
            <td width="70" class="title_center"><%= label.getLabelName("L_Resource") %></td>
            <td width="60" class="title_center"><%= label.getLabelName("L_IsOpen") %></td>
            <td width="70" class="title_center"><%= label.getLabelName("L_BuildDate") %></td>
            <td width="40" class="title_center"><%= label.getLabelName("L_Status") %></td>
          </tr>
          
          <%
            Vector noteshistorysummary = (Vector)pageContext.getAttribute("noteshistorysummary");
            if (noteshistorysummary == null) noteshistorysummary = new Vector();
            
            String strClassType = "";
            String strChecked = "";
            boolean bHasChecked = false;
            Integer nDefaultNotesId = new Integer(-1);
          %>
          
          <logic:iterate id="summaryitem" collection="<%= noteshistorysummary %>" indexId="columnId">
          <%
            if(columnId.intValue()%2 == 1)
            {
              strClassType = "td-listrom";
            }
            else
            {
              strClassType = "none";
            }
            
            if (!bHasChecked)
            {
              nDefaultNotesId = (Integer)((HashMap)pageContext.getAttribute("summaryitem")).get("notesid");
              
              bHasChecked = true;
              strChecked = "Checked";
            }
            else
            {
              strChecked = "";
            }
          %>
          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'" onClick="javascript:radiotrue('id<%=JspHelper.filterNull( columnId.intValue() )%>');javascript:clickNote(<custom:write name="summaryitem" property="notesid"/>)" class="<%=JspHelper.filterNull( strClassType )%>">
            <td>
              <input <%=JspHelper.filterNull( strChecked )%> id="id<%=JspHelper.filterNull( columnId.intValue() )%>" type="radio" name="notes" value="<custom:write name="summaryitem" property="notesid"/>" class="normalradio">
            </td>
            <td><a href="NotesInfo.jsp?<%= OvalTools.randomURL() %>&from=history&notesid=<custom:write name="summaryitem" property="notesid"/>" target="down"><custom:write name="summaryitem" property="title" nbsp="true"/></a></td>
            <td><custom:write name="summaryitem" property="fromusername" nbsp="true"/></td>
            <td><custom:write name="summaryitem" property="ispublic" nbsp="true"/></td>
            <td><custom:write name="summaryitem" property="begindate" dataType="date" dataFormatName="dateformat" nbsp="true"/></td>
            <td><custom:write name="summaryitem" property="statusname" nbsp="true"/></td>
          </tr>
          </logic:iterate>
          
          <%@include file="/inc/SummaryAction.inc" %>
          
          <input type="hidden" name="notesid" value="<%=JspHelper.filterNull( nDefaultNotesId )%>">
        
      </table>
    </td>
  </tr>
  <tr> 
    <td class="td_center">
      <a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
    </td>
  </tr>
</table>
</form>
</body>
</html>
